<?php

class commonClass  {
	function Listion_user(){
		session_start ();
		if (isset ( $_SESSION ["uid"] ) && $_SESSION ["uid"] != "") {
			return $_SESSION["uid"];
		}elseif(isset ( $_COOKIE ["uid"] ) && $_COOKIE ["uid"] != ""){
			$_SESSION['uid'] = $_COOKIE['uid'];
			$_SESSION['usermail'] = $_COOKIE['usermail'];
			return $_COOKIE['uid'];
		}
		return false;
	}
	function rand_string(){
		$arr = array_merge(range(1, 9) , range('A', 'Z'), range('a', 'z'));
		$str = "";
		for ($i = 0; $i < 8 ;$i++){
			$str .= $arr[rand(0, count($arr)-1)];
		}
		return $str;
	}
}